package com.gaofei.controller;

import com.gaofei.utils.SendMsgUtil;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : gaofee
 * @date : 9:38 2021/6/24
 * @码云地址 : https://gitee.com/itgaofee
 */
@RestController
public class RabbitController {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("send")

    public String send(){
        rabbitTemplate.convertAndSend("bizExchange","","你好,我是一个消息!!!!");
        return "发送成功!!";
    }

    @RequestMapping("sendMsg")
    public String send(Integer num){
        SendMsgUtil.send("17630978027",num);
        return "发送成功!!";
    }
}
